#include <QApplication>
#include <QObject>
#include "MainWindow.h"
#include "WorkerThread.h"


int main(int argc, char** argv)
{
    QApplication a(argc, argv);
    // 主窗口, 用来展示渲染结果
    MainWindow w;
    w.show();
    // 工作线程, 进行渲染
    WorkerThread thread;

    // 连接信号槽
    QObject::connect(&thread, SIGNAL(Show(const uint8_t*)), &w, SLOT(UpdateView(const uint8_t*)));
    QObject::connect(&w, SIGNAL(CloseSignal()), &thread, SLOT(Stop()));
    thread.start();

    return QApplication::exec();
}
